<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span {
            border: 1px red solid;
            /* 有效 */
            margin: 0 50px;
            padding: 0 50px;
            /* 无效 */
            margin: 50px 0;
            padding-bottom: 30px;
        }

        div {
            width: 300px;
            height: 100px;
            background: pink;
        }
    </style>
</head>

<body>
    <div>盒子1</div>
    <!-- 1. 水平方向的margin和padding布局中有效！
2. 垂直方向的margin和padding布局中无效 -->
    <span>1</span> <span>2</span> <span>3</span>
    <div>盒子2</div>
</body>

</html>